<!--{subtemplate common/header}-->

<!--{if $_G[gp_action] == 'edit'}--><!--{eval $editor[value] = $postinfo[message];}--><!--{else}--><!--{eval $editor[value] = $message;}--><!--{/if}-->
<script type="text/javascript" src="{$_G['setting']['jspath']}forum_post.js?{VERHASH}"></script>

<!--{block actiontitle}-->
	<!--{if $_G['gp_action'] == 'newthread'}-->
		<!--{if $special == 0}-->{lang post_newthread}
		<!--{elseif $special == 1}-->{lang post_newthreadpoll}
		<!--{elseif $special == 2}-->{lang post_newthreadtrade}
		<!--{elseif $special == 3}-->{lang post_newthreadreward}
		<!--{elseif $special == 4}-->{lang post_newthreadactivity}
		<!--{elseif $special == 5}-->{lang post_newthreaddebate}
		<!--{elseif $specialextra}-->{$_G['setting']['threadplugins'][$specialextra][name]}
		<!--{/if}-->
	<!--{elseif $_G['gp_action'] == 'reply' && !empty($_G['gp_addtrade'])}-->
		{lang trade_add_post}
	<!--{elseif $_G['gp_action'] == 'reply'}-->
		{lang join_thread}
	<!--{elseif $_G['gp_action'] == 'edit'}-->
		<!--{if $special == 2}-->{lang edit_trade}<!--{else}-->{lang edit_thread}<!--{/if}-->
	<!--{/if}-->
<!--{/block}-->

<!--{block icon}-->
	<!--{if $special == 1}-->poll
	<!--{elseif $special == 2}-->trade
	<!--{elseif $special == 3}-->reward
	<!--{elseif $special == 4}-->activity
	<!--{elseif $special == 5}-->debate
	<!--{elseif $isfirstpost && $sortid}-->sort
	<!--{/if}-->
<!--{/block}-->

<!--{if $_G['gp_action'] != 'newthread'}-->
	<!--{eval $subjectcut = cutstr($thread[subject], 30);}-->
<!--{/if}-->
<!--{block actionsubject}-->
	<!--{if $_G['gp_action'] == 'reply'}-->
		<em>&rsaquo;</em><a href="forum.php?mod=viewthread&tid=$thread[tid]">$subjectcut</a>
	<!--{elseif $_G['gp_action'] == 'edit'}-->
		<em>&rsaquo;</em><a href="forum.php?mod=redirect&goto=findpost&ptid=$thread[tid]&pid=$pid">$subjectcut</a>
	<!--{/if}-->
<!--{/block}-->

<div id="pt" class="bm cl">
	<!--{subtemplate common/simplesearchform}-->
	<div class="z"><a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a> $navigation$actionsubject <em>&rsaquo;</em> $actiontitle</div>
</div>

<!--{eval $adveditor = $isfirstpost && $special || $special == 2 && ($_G['gp_action'] == 'newthread' || $_G['gp_action'] == 'reply' && !empty($_G['gp_addtrade']) || $_G['gp_action'] == 'edit' && $thread['special'] == 2);}-->
<!--{eval $advmore = !$showthreadsorts && !$special || $_G['gp_action'] == 'reply' && empty($_G['gp_addtrade']) || $_G['gp_action'] == 'edit' && !$isfirstpost && ($thread['special'] == 2 && !$special || $thread['special'] != 2);}-->
<div id="ct" class="ct2_a wp cl">
	<div class="mn">
		<form method="post" autocomplete="off" id="postform"
			{if $_G[gp_action] == 'newthread'}action="forum.php?mod=post&action={if $special != 2}newthread{else}newtrade{/if}&fid=$_G[fid]&extra=$extra&topicsubmit=yes"
			{elseif $_G[gp_action] == 'reply'}action="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&extra=$extra&replysubmit=yes"
			{elseif $_G[gp_action] == 'edit'}action="forum.php?mod=post&action=edit&extra=$extra&editsubmit=yes" $enctype
			{/if}
			onsubmit="return validate(this)">
			<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
			<input type="hidden" name="posttime" id="posttime" value="{TIMESTAMP}" />
			<!--{if !empty($_G['gp_modthreadkey'])}--><input type="hidden" name="modthreadkey" id="modthreadkey" value="$_G['gp_modthreadkey']" /><!--{/if}-->
			<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode" />
			<!--{if $_G[gp_action] == 'reply'}-->
				<input type="hidden" name="noticeauthor" value="$noticeauthor" />
				<input type="hidden" name="noticetrimstr" value="$noticetrimstr" />
				<input type="hidden" name="noticeauthormsg" value="$noticeauthormsg" />
				<!--{if $_G[gp_reppost]}-->
					<input type="hidden" name="reppost" value="$_G[gp_reppost]" />
				<!--{elseif $_G[gp_repquote]}-->
					<input type="hidden" name="reppost" value="$_G[gp_repquote]" />
				<!--{/if}-->
			<!--{/if}-->
			<!--{if $_G[gp_action] == 'edit'}-->
				<input type="hidden" name="fid" id="fid" value="$_G[fid]" />
				<input type="hidden" name="tid" value="$_G[tid]" />
				<input type="hidden" name="pid" value="$pid" />
				<input type="hidden" name="page" value="$_G[gp_page]" />
			<!--{/if}-->
			<!--{if $special}-->
				<input type="hidden" name="special" value="$special" />
			<!--{/if}-->
			<!--{if $specialextra}-->
				<input type="hidden" name="specialextra" value="$specialextra" />
			<!--{/if}-->
			<div class="bm bw0 cl"{if !$showthreadsorts && !$adveditor} id="editorbox"{/if}>
				<h1 id="sti" class="mt">
					<em class="wx $icon" id="returnmessage">
						$actiontitle
						<!--{if $showthreadsorts}--> $_G['forum'][threadsorts][types][$sortid]<!--{/if}-->
						<!--{if $_G[gp_action] == 'newthread' && $modnewthreads}--><span class="xg1">({lang approve})</span><!--{/if}-->
						<!--{if $_G[gp_action] == 'reply' && $modnewreplies}--><span class="xg1">({lang approve})</span><!--{/if}-->
						<!--{if $_G[gp_action] == 'edit' && $isfirstpost && $thread['displayorder'] == -4}--><span class="xg1">({lang draft})</span><!--{/if}-->
					</em>
				</h1>
				<div id="postbox">
					<!--{hook/post_top}-->
					<div class="pbt cl">
						<!--{if !$special && ($threadsorts = $_G['forum']['threadsorts']) && ($_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost && !$thread['sortid'])}-->
						<div class="ftid">
							<select name="sortid" id="sortid" width="80" change="switchsort()">
							<!--{if !$_G['forum']['threadsorts']['required']}--><option value="0">{lang select_category_info}</option><!--{/if}-->
							<!--{loop $threadsorts[types] $tsortid $name}-->
								<option value="$tsortid"{if $sortid == $tsortid} selected="selected"{/if}><!--{echo strip_tags($name);}--></option>
							<!--{/loop}-->
							</select>
						</div>
						<!--{/if}-->
						<!--{if $_G[gp_action] == 'edit' && $isfirstpost && $sortid}-->
							<input type="hidden" name="sortid" value="$sortid" />
						<!--{/if}-->
						<!--{if $isfirstpost && !empty($_G['forum'][threadtypes][types])}-->
						<div class="ftid">
							<select name="typeid" id="typeid" width="80">
							<option value="0">{lang select_thread_catgory}</option>
							<!--{loop $_G['forum'][threadtypes][types] $typeid $name}-->
								<option value="$typeid"{if $thread['typeid'] == $typeid || $_G['gp_typeid'] == $typeid} selected="selected"{/if}><!--{echo strip_tags($name);}--></option>
							<!--{/loop}-->
							</select>
						</div>
						<!--{/if}-->
						<div class="z">
							<!--{if $_G[gp_action] == 'reply' && !empty($_G['gp_addtrade']) || $_G[gp_action] == 'edit' && $thread['special'] == 2 && !$postinfo['first']}-->
								<input name="subject" type="hidden" value="" />
							<!--{else}-->
								<!--{if $_G[gp_action] != 'reply'}-->
									<span><input type="text" name="subject" id="subject" class="px" value="$postinfo[subject]" onkeyup="strLenCalc(this, 'checklen', 80);" tabindex="1" style="width: 25em" /></span>
								<!--{else}-->
									<span id="subjecthide" class="z">RE: $thread[subject] [<a href="javascript:;" onclick="display('subjecthide');display('subjectbox');$('subject').value='RE: {echo htmlspecialchars(str_replace('\'', '\\\'', $thread[subject]))}';display('subjectchk');strLenCalc($('subject'), 'checklen', 80);">{lang modify}</a>]</span>
									<span id="subjectbox" style="display:none"><input type="text" name="subject" id="subject" class="px" value="" onkeyup="strLenCalc(this, 'checklen', 80);" tabindex="1" style="width: 25em" /></span>
								<!--{/if}-->
								<span id="subjectchk"{if $_G[gp_action] == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
							<!--{/if}-->
						</div>
						<!--{if $_G[gp_action] == 'edit' && $isorigauthor && ($isfirstpost && $thread['replies'] < 1 || !$isfirstpost) && !$rushreply && $_G['setting']['editperdel']}-->
							<div class="y"><input type="checkbox" name="delete" id="delete" class="pc" value="1" title="{lang post_delpost}{if $thread[special] == 3}{lang reward_price_back}{/if}"><label for="delete">{lang delete_check}</label></div>
						<!--{/if}-->
					</div>
					<!--{if !$isfirstpost && $thread[special] == 5 && empty($firststand) && $_G[gp_action] != 'edit'}-->
					<div class="pbt cl">
						<div class="ftid">
							<select name="stand" id="stand">
								<option value="">{lang debate_viewpoint}</option>
								<option value="0">{lang debate_neutral}</option>
								<option value="1"{if $stand == 1} selected="selected"{/if}>{lang debate_square}</option>
								<option value="2"{if $stand == 2} selected="selected"{/if}>{lang debate_opponent}</option>
							</select>
						</div>
					</div>
					<!--{/if}-->
			<!--{if $showthreadsorts}-->
				<div class="exfm cl" id="threadsorts">
					<span id="threadsortswait"></span>
				</div>
			<!--{elseif $adveditor}-->
				<!--{if $special == 1}--><!--{template forum/post_poll}-->
				<!--{elseif $special == 2 && ($_G[gp_action] != 'edit' || ($_G[gp_action] == 'edit' && ($thread['authorid'] == $_G['uid'] && $_G['group']['allowposttrade'] || $_G['group']['allowedittrade'])))}--><p class="xg1">{lang post_message1}</p><!--{template forum/post_trade}-->
				<!--{elseif $special == 3}--><!--{template forum/post_reward}-->
				<!--{elseif $special == 4}--><!--{template forum/post_activity}-->
				<!--{elseif $special == 5}--><!--{template forum/post_debate}-->
				<!--{elseif $specialextra}--><div class="specialpost s_clear">$threadplughtml</div>
				<!--{/if}-->
			<!--{/if}-->
			<!--{if $_G[gp_action] == 'reply' && $quotemessage}-->
				<div class="pbt cl">$quotemessage</div>
			<!--{/if}-->
			<div class="edt" id="{$editorid}_body">
				<div id="{$editorid}_controls" class="bar">
					<div class="y">
						<div class="b2r nbl nbr" id="{$editorid}_adv_5">
							<p>
								<a id="{$editorid}_undo" title="{lang e_undo}">Undo</a>
							</p>
							<p>
								<a id="{$editorid}_redo" title="{lang e_redo}">Redo</a>
							</p>
						</div>
						<div class="z">
							<span class="mbn"><a id="{$editorid}_fullswitcher"></a><a id="{$editorid}_simple"></a></span>
							<label id="{$editorid}_switcher" class="bar_swch ptn"><input id="{$editorid}_switchercheck" type="checkbox" class="pc" name="checkbox" value="0" {if !$editor[editormode]}checked="checked"{/if} onclick="switchEditor(this.checked?0:1)" />{lang code}</label>
						</div>
					</div>
					<!--{if !empty($_G[setting][pluginhooks][post_editorctrl_right])}-->
						<div class="y"><!--{hook/post_editorctrl_right}--></div>
					<!--{/if}-->
					<div id="{$editorid}_button" class="btn cl">
						<div class="b1r" id="{$editorid}_adv_s0">
							<a id="{$editorid}_paste" title="{lang e_paste}">{lang e_paste}</a>
						</div>
						<div class="b2r nbr" id="{$editorid}_adv_s2">
							<a id="{$editorid}_fontname" class="dp" title="{lang e_fontname}"><span id="{$editorid}_font">{lang e_font}</span></a>
							<a id="{$editorid}_fontsize" class="dp" title="{lang e_fontsize}"><span id="{$editorid}_size">{lang e_size}</span></a>
							<br id="{$editorid}_adv_1" />
							<a id="{$editorid}_bold" title="{lang e_bold}">B</a>
							<a id="{$editorid}_italic" title="{lang e_italic}">I</a>
							<a id="{$editorid}_underline" title="{lang e_underline}">U</a>
							<a id="{$editorid}_forecolor" title="{lang e_forecolor}">Color</a>
							<a id="{$editorid}_url" title="{lang e_url}">Url</a>
							<span id="{$editorid}_adv_8">
							<a id="{$editorid}_unlink" title="{lang e_unlink}">Unlink</a>
							<a id="{$editorid}_inserthorizontalrule" title="{lang e_hr_title}">Hr</a>
							</span>
						</div>
						<div class="b2r nbl" id="{$editorid}_adv_2">
							<p id="{$editorid}_adv_3">
								<a id="{$editorid}_tbl" title="{lang e_table}">Table</a>
							</p>
							<p>
								<a id="{$editorid}_removeformat" title="{lang e_removeformat}">Removeformat</a>
							</p>
						</div>
						<div class="b2r">
							<p>
								<a id="{$editorid}_justifyleft" title="{lang e_left}">Left</a>
								<a id="{$editorid}_justifycenter" title="{lang e_center}">Center</a>
								<a id="{$editorid}_justifyright" title="{lang e_right}">Right</a>
							</p>
							<p id="{$editorid}_adv_4">
								<a id="{$editorid}_autotypeset" title="{lang e_autotypeset}">Autotypeset</a>
								<a id="{$editorid}_insertorderedlist" title="{lang e_orderedlist}">Orderedlist</a>
								<a id="{$editorid}_insertunorderedlist" title="{lang e_unorderedlist}">Unorderedlist</a>								
							</p>
						</div>
						<div class="b1r" id="{$editorid}_adv_s1">
							<a id="{$editorid}_sml" title="{lang e_smilies_title}">{lang e_smilies}</a>
							<div id="{$editorid}_imagen" style="display:none">!</div>
							<a id="{$editorid}_image" title="{lang e_image_title}">{lang e_image}</a>
							<!--{if $_G['group']['allowpostattach']}-->
								<div id="{$editorid}_attachn" style="display:none">!</div>
								<a id="{$editorid}_attach" title="{lang e_attach_title}">{lang e_attach}</a>
							<!--{/if}-->
							<!--{if $_G['forum']['allowmediacode']}-->
								<a id="{$editorid}_aud" title="{lang e_audio_title}">{lang e_audio}</a>
								<a id="{$editorid}_vid" title="{lang e_video_title}">{lang e_video}</a>
								<a id="{$editorid}_fls" title="{lang e_flash_title}">{lang e_flash}</a>
							<!--{/if}-->
							<!--{hook/post_editorctrl_left}-->
						</div>
						<div class="b2r{if $_G['cache']['bbcodes_display'][$_G['groupid']]} nbr{/if}" id="{$editorid}_adv_6">
							<p>
								<a id="{$editorid}_code" title="{lang e_code_title}">{lang e_code}</a>
								<!--{if $isfirstpost && $_G['group']['allowhidecode']}--><a id="{$editorid}_hide" title="{lang e_hide}">Hide</a><!--{/if}-->
							</p>
							<p>
								<a id="{$editorid}_quote" title="{lang e_quote_title}">{lang e_quote}</a>
								<!--{if $isfirstpost}--><a id="{$editorid}_free" title="{lang e_free}">Free</a><!--{/if}-->
							</p>
						</div>
						<!--{if $_G['cache']['bbcodes_display'][$_G['groupid']]}-->
						<div class="b2r nbl">
							<!--{loop $_G['cache']['bbcodes_display'][$_G['groupid']] $tag $bbcode}-->
								<!--{if $bbcode['i'] % 2 != 0}--><a id="{$editorid}_cst{$bbcode[params]}_$tag" class="cst" title="$bbcode[explanation]"><img src="{STATICURL}image/common/$bbcode[icon]" title="$bbcode[explanation]" alt="$tag" /></a><!--{/if}-->
							<!--{/loop}-->
							<!--{hook/post_editorctrl_top}-->
							<br id="{$editorid}_adv_7" />
							<!--{loop $_G['cache']['bbcodes_display'][$_G['groupid']] $tag $bbcode}-->
								<!--{if $bbcode['i'] % 2 == 0}--><a id="{$editorid}_cst{$bbcode[params]}_$tag" class="cst" title="$bbcode[explanation]"><img src="{STATICURL}image/common/$bbcode[icon]" title="$bbcode[explanation]" alt="$tag" /></a><!--{/if}-->
							<!--{/loop}-->
							<!--{hook/post_editorctrl_bottom}-->
						</div>
						<!--{/if}-->
						<!--{if $_G['setting']['magicstatus'] && !empty($_G['setting']['magics']['doodle'])}-->
							<div class="b2r">
								<a id="a_magic_doodle" href="home.php?mod=magic&mid=doodle&showid=comment_doodle&target={$editorid}_textarea&from=forumeditor" class="cst" onclick="showWindow(this.id, this.href, 'get', 0)"><img src="{STATICURL}image/magic/doodle.small.gif" alt="doodle" title="$_G['setting']['magics']['doodle']" style="margin-top:2px" /></a>
							</div>
						<!--{/if}-->
					</div>
				</div>

				<div class="area">
					<textarea name="$editor[textarea]" id="{$editorid}_textarea" class="pt" tabindex="2" rows="15">$editor[value]</textarea>
				</div>
				<!--{subtemplate common/editor}-->
			</div>

			<!--{hook/post_middle}-->

			<!--{if $_G['group']['maxprice'] && ($_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost)}-->
				<div class="mtm">
					<!--{if $_G['setting']['maxincperthread']}--><img src="{IMGDIR}/arrow_right.gif" />{lang post_price_income_comment}<!--{/if}-->
					<!--{if $_G['setting']['maxchargespan']}--><img src="{IMGDIR}/arrow_right.gif" />{lang post_price_charge_comment}<!--{if $_G[gp_action] == 'edit' && $freechargehours}-->{lang post_price_free_chargehours}<!--{/if}--><!--{/if}-->
				</div>
			<!--{/if}-->

			<!--{if $_G[gp_action] != 'edit' && checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->
				<!--{block sectpl}--><sec> <span id="sec<hash>" onclick="showMenu(this.id);"><sec></span><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div><!--{/block}-->
				<div class="mtm"><!--{template common/seccheck}--></div>
			<!--{/if}-->

			<div class="mtm mbm">
				<!--{if $_G[gp_action] == 'newthread' && $_G['setting']['sitemessage'][newthread] || $_G[gp_action] == 'reply' && $_G['setting']['sitemessage'][reply]}-->
					<span id="custominfo" class="y" style="cursor:pointer">&nbsp;<img src="{IMGDIR}/info_small.gif" alt="{lang faq}" /></span>
				<!--{/if}-->
				<a href="home.php?mod=spacecp&ac=credit&op=rule&fid=$_G['fid']" class="y" target="_blank">{lang post_credits_rule}</a>
				<button type="submit" id="postsubmit" class="pn pnc" value="true" name="{if $_G[gp_action] == 'newthread'}topicsubmit{elseif $_G[gp_action] == 'reply'}replysubmit{elseif $_G[gp_action] == 'edit'}editsubmit{/if}">
				<!--{if $_G[gp_action] == 'newthread'}-->
					<!--{if $special == 0}--><span>{lang post_newthread}</span>
					<!--{elseif $special == 1}--><span>{lang post_newthreadpoll}</span>
					<!--{elseif $special == 2}--><span>{lang post_newthreadtrade}</span>
					<!--{elseif $special == 3}--><span>{lang post_newthreadreward}</span>
					<!--{elseif $special == 4}--><span>{lang post_newthreadactivity}</span>
					<!--{elseif $special == 5}--><span>{lang post_newthreaddebate}</span>
					<!--{elseif $special == 127}-->
						<span><!--{if $buttontext}-->$buttontext<!--{else}-->{lang post_newthread}<!--{/if}--></span>
					<!--{/if}-->
				<!--{elseif $_G[gp_action] == 'reply' && !empty($_G['gp_addtrade'])}--><span>{lang trade_add_post}</span>
				<!--{elseif $_G[gp_action] == 'reply'}--><span>{lang join_thread}</span>
				<!--{elseif $_G[gp_action] == 'edit' && $isfirstpost && $thread['displayorder'] == -4}-->
					<span>{lang post_newthread}</span>
				<!--{elseif $_G[gp_action] == 'edit'}--><span>{lang edit_save}</span>
				<!--{/if}-->
				</button>
				<!--{if $_G['uid']}-->
					<input type="hidden" id="postsave" name="save" value="" />				
					<!--{if $_G[gp_action] == 'newthread' && !$modnewthreads || $_G[gp_action] == 'edit' && $isfirstpost && !$modnewreplies && $thread['displayorder'] == -4}-->
						<button type="button" id="postsubmit" class="pn" value="true" onclick="$('postsave').value = 1;$('postsubmit').click();" tabindex="4"><em>{lang save_draft}</em></button>
					<!--{/if}-->
				<!--{/if}-->
				<!--{if $special == 2}--><label><input type="checkbox" name="continueadd" value="yes" class="pc" /> {lang post_message2}</label><!--{/if}-->
			</div>

			<!--{if $_G[gp_action] == 'newthread' && $savethreads}-->
				<div class="bm bmn mtm">
					<div class="mbn pbn bbda">
						<a href="home.php?mod=space&uid=$_G['uid']&do=thread&view=me&type=thread&from=&filter=save" class="y xi2">{lang post_message3} &rsaquo;</a>
						<h2>{lang post_message4}<span class="xi1"> $savethreadcount </span>{lang post_message5} <span class="xw0">{lang post_message6}<em class="qsv">&nbsp;</em>{lang post_message7}</span></h2>
					</div>
					<ul>
					<!--{loop $savethreads $savethread}-->
						<li class="mtn"><em class="qsv" title="{lang reply_quote}" onclick="insertsave($savethread[pid])">&nbsp;</em> <a href="forum.php?mod=post&action=edit&fid=$savethread[fid]&tid=$savethread[tid]&pid=$savethread[pid]" class="xi2" target="_blank">$savethread[subject]</a> <span class="xg1">$savethread[dateline]</span></li>
					<!--{/loop}-->
					</ul>
				</div>
			<!--{/if}-->

			<!--{if $_G[gp_action] == 'newthread' && $savethreadothers}-->
				<div class="bm bmn mtm">
					<div class="mbn pbn bbda">
						<a href="home.php?mod=space&uid=$_G['uid']&do=thread&view=me&type=thread&from=&filter=save" class="y xi2">{lang post_message3} &rsaquo;</a>
						<h2>{lang post_message4}<span class="xi1"> $savethreadothercount </span>{lang post_message5} <span class="xw0">{lang post_message6}<em class="qsv">&nbsp;</em>{lang post_message7}</span></h2>
					</div>
					<ul>
						<!--{loop $savethreadothers $savethread}-->
						<li class="mtn"><em class="qsv" title="{lang reply_quote}" onclick="insertsave($savethread[pid])">&nbsp;</em> <a href="forum.php?mod=post&action=edit&fid=$savethread[fid]&tid=$savethread[tid]&pid=$savethread[pid]" class="xi2" target="_blank">$savethread[subject]</a> <span class="xg1">$savethread[dateline]</span></li>
						<!--{/loop}-->
					</ul>
				</div>
			<!--{/if}-->

			<!--{hook/post_bottom}-->
		</div>
	</div>

	</div>

	<div id="psd" class="appl">
		<h3 class="mbm pbm bbs">{lang post_additional_options}</h3>
		<div class="bn">
			<!--{hook/post_side_top}-->
			<!--{if $_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost}-->
				<!--{if $_G['group']['allowsetreadperm']}-->
					<p class="mbn">{lang readperm}:</p>
					<p class="mbn">
						<em class="ftid">
							<select name="readperm" id="readperm" class="ps" style="width:90px">
								<option value="">{lang unlimited}</option>
								<!--{loop $_G['cache']['groupreadaccess'] $val}-->
									<option value="$val[readaccess]" title="{lang readperm}: $val[readaccess]"{if $thread['readperm'] == $val[readaccess]} selected="selected"{/if}>$val[grouptitle]</option>
								<!--{/loop}-->
								<option value="255">{lang highest_right}</option>
							</select>
						</em>
						<img src="{IMGDIR}/faq.gif" alt="Tip" class="mtn vm" style="margin: 0;" onmouseover="showTip(this)" tip="{lang post_select_usergroup_readacces}" /></a>
					</p>
				<!--{/if}-->
				<!--{if $_G['group']['maxprice'] && !$special}-->
					<p class="mbn">{lang price}({$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]}):</p>
					<p><input type="text" name="price" class="px pxs" value="$thread[pricedisplay]" /> {$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][unit]}</p>
					<p class="mbn xg1">({lang post_price_comment})</p>
				<!--{/if}-->
			<!--{/if}-->

			<!--{if ($_G['forum']['allowhtml'] || ($_G[gp_action] == 'edit' && ($orig['htmlon'] & 1))) && $_G['group']['allowhtml']}-->
				<p class="mbn"><input type="checkbox" name="htmlon" id="htmlon" class="pc" value="1" $htmloncheck /><label for="htmlon">{lang post_html}</label></p>
			<!--{else}-->
				<p class="mbn"><input type="checkbox" name="htmlon" id="htmlon" class="pc" value="0" $htmloncheck disabled="disabled" /><label for="htmlon">{lang post_html}</label></p>
			<!--{/if}-->
			<p class="mbn"><input type="checkbox" id="allowimgcode" class="pc" disabled="disabled"{if $_G['forum']['allowimgcode']} checked="checked"{/if} /><label for="allowimgcode">{lang post_imgcode}</label></p>
			<p class="mbn"><input type="checkbox" name="parseurloff" id="parseurloff" class="pc" value="1" $urloffcheck /><label for="parseurloff">{lang disable} {lang post_parseurl}</label></p>
			<p class="mbn"><input type="checkbox" name="smileyoff" id="smileyoff" class="pc" value="1" $smileyoffcheck /><label for="smileyoff">{lang disable} {lang smilies}</label></p>
			<p class="mbn"><input type="checkbox" name="bbcodeoff" id="bbcodeoff" class="pc" value="1" $codeoffcheck /><label for="bbcodeoff">{lang disable} {lang discuzcode}</label></p>

			<hr class="bk" />

			<p class="mbn"><input type="checkbox" name="usesig" id="usesig" class="pc" value="1" {if !$_G['group']['maxsigsize']}disabled {else}$usesigcheck {/if}/><label for="usesig">{lang post_show_sig}</label></p>
			<!--{if $_G[gp_action] != 'edit'}-->
				<!--{if $_G['group']['allowanonymous']}--><p class="mbn"><input type="checkbox" name="isanonymous" id="isanonymous" class="pc" value="1" /><label for="isanonymous">{lang post_anonymous}</label></p><!--{/if}-->
			<!--{else}-->
				<!--{if $_G['group']['allowanonymous'] || (!$_G['group']['allowanonymous'] && $orig['anonymous'])}--><p class="mbn"><input type="checkbox" name="isanonymous" id="isanonymous" class="pc" value="1" {if $orig['anonymous']}checked="checked"{/if} /><label for="isanonymous">{lang post_anonymous}</label></p><!--{/if}-->
			<!--{/if}-->
			<!--{if $_G[gp_action] == 'newthread' && $_G['group']['allowpostrushreply'] && $special != 2}-->
				<p class="mbn"><input type="checkbox" name="rushreply" id="rushreply" class="pc" value="1"><label for="rushreply">{lang rushreply}</label></p>
			<!--{/if}-->
			<!--{if $_G[gp_action] == 'edit' && getstatus($thread['status'], 3)}-->
				<p class="mbn"><input type="checkbox" disabled="disabled" class="pc" checked="checked"><label for="rushreply">{lang rushreply}</label></p>
			<!--{/if}-->

			<!--{if $_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost}-->
				<p class="mbn"><input type="checkbox" name="hiddenreplies" id="hiddenreplies" class="pc"{if $thread['hiddenreplies']} checked="checked"{/if} value="1"><label for="hiddenreplies">{lang hiddenreplies}</label></p>
			<!--{/if}-->
			<!--{if $_G['uid'] && ($_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost) && $special != 3}-->
				<p class="mbn"><input type="checkbox" name="ordertype" id="ordertype" class="pc" value="1" $ordertypecheck /><label for="ordertype">{lang post_descviewdefault}</label></p>
			<!--{/if}-->
			<!--{if ($_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost)}-->
				<p class="mbn"><input type="checkbox" name="allownoticeauthor" id="allownoticeauthor" class="pc" value="1"{if $allownoticeauthor} checked="checked"{/if} /><label for="allownoticeauthor">{lang post_noticeauthor}</label></p>
			<!--{/if}-->
			<!--{if $_G[gp_action] != 'edit' && $_G['forum']['allowfeed']}-->
				<p class="mbn"><input type="checkbox" name="addfeed" id="addfeed" class="pc" value="1" $addfeedcheck><label for="addfeed">{lang addfeed}</label></p>
			<!--{/if}-->

			<!--{if $_G[gp_action] == 'newthread' && $_G['forum']['ismoderator'] && ($_G['group']['allowdirectpost'] || !$_G['forum']['modnewposts'])}-->
				<hr class="bk" />

				<!--{if $_G[gp_action] == 'newthread' && $_G['forum']['ismoderator'] && ($_G['group']['allowdirectpost'] || !$_G['forum']['modnewposts'])}-->
					<p class="mbn"><input type="checkbox" name="sticktopic" id="sticktopic" class="pc" value="1" $stickcheck /><label for="sticktopic">{lang post_stick_thread}</label></p>
					<p class="mbn"><input type="checkbox" name="addtodigest" id="addtodigest" class="pc" value="1" $digestcheck /><label for="addtodigest">{lang post_digest_thread}</label></p>
				<!--{/if}-->
			<!--{elseif $_G[gp_action] == 'edit' && $_G['forum_auditstatuson']}-->
				<hr class="bk" />

				<p class="mbn"><input type="checkbox" name="audit" id="audit" class="pc" value="1"><label for="audit">{lang auditstatuson}</label></p>
			<!--{/if}-->
		</div>
		<!--{hook/post_side_bottom}-->
		</div>
	</div>
</form>
</div>

<div id="{$editorid}_menus" class="editorrow" style="overflow: hidden; margin-top: -5px; height: 0; border: none; background: transparent;">
	<!--{subtemplate common/editor_menu}-->
	<!--{subtemplate forum/editor_menu_forum}-->
</div>

<!--{if $special}-->
<script type="text/javascript" src="{$_G['setting']['jspath']}calendar.js?{VERHASH}"></script>
<!--{/if}-->
<script type="text/javascript">
	var editorsubmit = $('postsubmit');
	var editorform = $('postform');
	var allowpostattach = parseInt('{$_G['group']['allowpostattach']}');
	var allowpostimg = parseInt('$allowpostimg');
	var pid = parseInt('$pid');
	var extensions = '{$_G['group']['attachextensions']}';
	var imgexts = '$imgexts';
	var postminchars = parseInt('$_G['setting']['minpostsize']');
	var postmaxchars = parseInt('$_G['setting']['maxpostsize']');
	var disablepostctrl = parseInt('{$_G['group']['disablepostctrl']}');
	var seccodecheck = parseInt('<!--{if checkperm('seccode') && $seccodecheck}-->1<!--{else}-->0<!--{/if}-->');
	var secqaacheck = parseInt('<!--{if checkperm('seccode') && $secqaacheck}-->1<!--{else}-->0<!--{/if}-->');
	var typerequired = parseInt('{$_G[forum][threadtypes][required]}');
	var sortrequired = parseInt('{$_G[forum][threadsorts][required]}');
	var special = parseInt('$special');
	var isfirstpost = <!--{if $isfirstpost}-->1<!--{else}-->0<!--{/if}-->;
	var allowposttrade = parseInt('{$_G['group']['allowposttrade']}');
	var allowpostreward = parseInt('{$_G['group']['allowpostreward']}');
	var allowpostactivity = parseInt('{$_G['group']['allowpostactivity']}');
	var sortid = parseInt('$sortid');
	var special = parseInt('$special');
	var fid = $_G['fid'];

	<!--{if $isfirstpost && !empty($_G[forum][threadtypes][types])}-->
		simulateSelect('typeid');
	<!--{/if}-->
	<!--{if !$isfirstpost && $thread['special'] == 5 && empty($firststand) && $_G[gp_action] != 'edit'}-->
		simulateSelect('stand');
	<!--{/if}-->
	<!--{if !$special && $_G[forum][threadsorts] && ($_G[gp_action] == 'newthread' || $_G[gp_action] == 'edit' && $isfirstpost && !$thread[sortid])}-->
		simulateSelect('sortid');
		function switchsort() {
			if($('sortid').value) {
				saveData(1);
				<!--{if $isfirstpost && $sortid}-->
					ajaxget('forum.php?mod=post&action=threadsorts&sortid=' + $('sortid').value + '&fid=$_G[fid]<!--{if !empty($modelid)}-->&modelid=$modelid<!--{/if}--><!--{if !empty($_G[gp_modthreadkey])}-->&modthreadkey=$_G[gp_modthreadkey]<!--{/if}-->', 'threadsorts', 'threadsortswait', null, null, function () { seteditorcontrolpos(); });
				<!--{else}-->
					location.href = 'forum.php?mod=post&action=$_G[gp_action]&fid=$_G[fid]<!--{if !empty($_G[tid])}-->&tid=$_G[tid]<!--{/if}--><!--{if !empty($pid)}-->&pid=$pid<!--{/if}--><!--{if !empty($modelid)}-->&modelid=$modelid<!--{/if}-->&extra=$extra<!--{if !$sortid}-->&cedit=yes<!--{/if}-->&sortid=' + $('sortid').value;
				<!--{/if}-->
				Editorwin = 0;
			}
		}
	<!--{/if}-->
	<!--{if $isfirstpost}-->
		<!--{if $sortid}-->
			ajaxget('forum.php?mod=post&action=threadsorts&sortid=$sortid&fid=$_G[fid]<!--{if !empty($_G[tid])}-->&tid=$_G[tid]<!--{/if}-->&inajax=1<!--{if !empty($_G[gp_modthreadkey])}-->&modthreadkey=$_G[gp_modthreadkey]<!--{/if}-->', 'threadsorts', 'threadsortswait', null, null, function () { seteditorcontrolpos(); });
		<!--{elseif $_G['forum']['threadsorts']['required'] && !$special}-->
			<!--{eval $threadsortids = array_keys($threadsorts[types]);}-->
			ajaxget('forum.php?mod=post&action=threadsorts&sortid={$threadsortids[0]}&fid=$_G[fid]<!--{if !empty($_G[tid])}-->&tid=$_G[tid]<!--{/if}-->&inajax=1<!--{if !empty($_G[gp_modthreadkey])}-->&modthreadkey=$_G[gp_modthreadkey]<!--{/if}-->', 'threadsorts', 'threadsortswait', null, null, function () { seteditorcontrolpos(); });
		<!--{/if}-->
	<!--{/if}-->

	<!--{if $_G[gp_action] == 'newthread' && $_G['setting']['sitemessage'][newthread] || $_G[gp_action] == 'reply' && $_G['setting']['sitemessage'][reply]}-->
		showPrompt('custominfo', 'mouseover', '<!--{if $_G[gp_action] == 'newthread'}--><!--{echo trim($_G['setting']['sitemessage'][newthread][array_rand($_G['setting']['sitemessage'][newthread])])}--><!--{elseif $_G[gp_action] == 'reply'}--><!--{echo trim($_G['setting']['sitemessage'][reply][array_rand($_G['setting']['sitemessage'][reply])])}--><!--{/if}-->', $_G['setting']['sitemessage'][time]);
	<!--{/if}-->
	<!--{if $_G['setting']['swfupload'] != 1 && $_G['group']['allowpostattach']}-->addAttach();<!--{/if}-->
	<!--{if $_G['setting']['swfupload'] != 1 && $allowpostimg}-->addAttach('img');<!--{/if}-->

	if($('subjectbox')) {
		var tmp_obj = $('e_textarea');
		if(tmp_obj && tmp_obj.style.display == '') {
			tmp_obj.focus();
		}
	} else if($('subject')) {
		$('subject').focus();
	}
</script>

<!--{subtemplate common/footer}-->